package cn.itsub.sodo.core;

import java.awt.image.BufferedImage;

import cn.itsub.sodo.util.FileUtil;
import cn.itsub.sodo.core.types.Size;

/**
 * 纹理图片
 * @author Mr.Xia@zhenzhigu.com
 * @Date 2016年10月26日
 */
public class Texture2D {
	
	public static final int kMaxTextureSize = 1024;
	
	private BufferedImage image;
	private Size contentSize;
	public Texture2D() { }
	public Texture2D(BufferedImage image){
		this.image = image;
		contentSize = new Size(image.getWidth(), image.getHeight());
	}
	
	public void initWithFileName(String fileName) {
		image = FileUtil.loadImage(fileName);
		contentSize = new Size(image.getWidth(), image.getHeight());
	}
	
	public BufferedImage getImage(){
		return this.image;
	}
	
	
	public int getWidth(){
		return (int) this.contentSize.width;
	}
	public int getHeight(){
		return (int) this.contentSize.height;
	}
	public Size getSize(){
		return this.contentSize;
	}
}
